import { COMMAND_STATUS } from "../interface";
import { BaseCommand } from "./BaseCommand";
import { API_EVENT } from "@/FrontProcessing/interface/api.interface";
/**
 * Cmd_Normal_Get
 * @description 获取法向量
 */
export class Cmd_Normal_Get extends BaseCommand {
  event = API_EVENT.NORMAL_GET;

  execute(): Promise<any> {
    this.system.history.push(this);
    return new Promise((resolve) => {
      this.status = COMMAND_STATUS.RUNNING;
      this.system.normal_get(this.params).then((result: any) => {
        this.status = COMMAND_STATUS.FINISHED;
        resolve(result);
      });
    });
  }

  undo(): boolean {
    return true;
  }
}
